<div class="barcode-generator"><canvas class="bar-output" ng-if="$ctrl.model" ng-init="$ctrl.initOutput()"></canvas><h6 ng-bind="$ctrl.encode"></h6><input ng-if="!$ctrl.viewOnly" type="text" maxlength="{{$ctrl.maxLength}}" ng-model="$ctrl.model" ng-change="$ctrl.generate()"> <select ng-model="$ctrl.encode" ng-change="$ctrl.generate()"><option ng-repeat="item in $ctrl.encodes">{{item}}</option></select> <a class="btn btn-success" ng-if="!$ctrl.viewOnly" ng-click="$ctrl.generate()">Reload</a> <a ng-if="$ctrl.model" class="btn-link" ng-click="$ctrl.download()">Download</a><p ng-bind="$ctrl.error" class="text-danger"></p></div>